<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>账户信息修改</title>
    <style>
        :root {
            --primary-color: #165DFF;
            --secondary-color: #4080FF;
            --accent-color: #FF7D00;
            --text-color: #333333;
            --light-text: #666666;
            --bg-color: #F5F7FA;
            --card-bg: #FFFFFF;
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            --border-radius: 12px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
        }

        body {
            background-color: var(--bg-color);
            background-image: 
                radial-gradient(circle at 25% 25%, rgba(22, 93, 255, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(22, 93, 255, 0.03) 0%, transparent 50%);
            background-attachment: fixed;
            min-height: 100vh;
            color: var(--text-color);
        }

        .header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            padding: 20px 40px;
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            z-index: 10;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-size: 24px;
            font-weight: 700;
            color: var(--primary-color);
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: var(--accent-color);
        }

        .button {
            background-color: var(--primary-color);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: var(--border-radius);
            cursor: pointer;
            text-decoration: none;
            transition: all 0.3s ease;
            margin-right: 15px;
            display: inline-flex;
            align-items: center;
        }

        .button:hover {
            background-color: var(--secondary-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(22, 93, 255, 0.2);
        }

        .button i {
            margin-right: 5px;
        }

        .logout-button {
            background-color: #FF0000;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: var(--border-radius);
            cursor: pointer;
            text-decoration: none;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
        }

        .logout-button:hover {
            background-color: #CC0000;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(204, 0, 0, 0.2);
        }

        .logout-button i {
            margin-right: 5px;
        }

        .nav-buttons {
            display: flex;
            align-items: center;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 120px 40px 40px;
        }

        .profile-name {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 30px;
            color: var(--primary-color);
        }

        .card {
            background: var(--card-bg);
            border-radius: var(--border-radius);
            box-shadow: 0 8px 30px rgba(22, 93, 255, 0.15);
            padding: 30px;
            transition: all 0.3s ease;
            border: 1px solid rgba(22, 93, 255, 0.1);
            position: relative;
            overflow: hidden;
        }

        .card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 6px;
            background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
        }

        .card:hover {
            transform: translateY(-8px);
            box-shadow: 0 12px 40px rgba(22, 93, 255, 0.2);
        }

        .form-button {
            background-color: var(--primary-color);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: var(--border-radius);
            cursor: pointer;
            text-decoration: none;
            font-size: 16px;
            transition: all 0.3s ease;
            margin-top: 20px;
            margin-right: 15px;
        }

        .form-button:hover {
            background-color: var(--secondary-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(22, 93, 255, 0.2);
        }

        .input-field {
            width: 100%;
            padding: 10px 15px;
            border: 1px solid #E0E3E9;
            border-radius: var(--border-radius);
            font-size: 16px;
            transition: all 0.3s ease;
            margin-bottom: 15px;
        }

        .input-field:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.2);
        }

        .error-message {
            color: red;
            margin-bottom: 20px;
        }

        .footer {
            text-align: center;
            padding: 20px;
            color: var(--light-text);
            font-size: 14px;
            margin-top: 60px;
        }
    </style>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
    <!-- 顶部导航 -->
    <div class="header">
        <div class="logo">
            <i class="fa fa-bank"></i>
            安心银行
        </div>
        <div class="nav-buttons">
            <a href="/personal" class="button">
                <i class="fa fa-user-circle"></i> 个人中心
            </a>
            <a href="/" class="logout-button">
                <i class="fa fa-sign-out"></i> 退出登录
            </a>
        </div>
    </div>

    <!-- 主要内容 -->
    <div class="container">
        <div class="profile-name">账户信息修改</div>
        <div class="card">
            {% if error_msg %}
            <p class="error-message">{{ error_msg }}</p>
            {% endif %}

            <!-- 操作按钮 -->
            <form method="POST">
                <button type="submit" name="btn_password" class="form-button">修改账户密码</button>
                <button type="submit" name="btn_phone" class="form-button">修改账户电话</button>
                <button type="submit" name="btn_card" class="form-button">修改银行卡密码</button>
            </form>

            <!-- 当有激活的表单时，同时显示身份验证和对应功能表单 -->
            {% if active_form %}
            <form method="POST">
                <!-- 身份验证部分 -->
                <h3>身份验证</h3>
                <p>身份证号：<input type="text" name="pid" class="input-field" required></p>
                <p>电话号码：<input type="tel" name="telephone" class="input-field" required></p>
                <p>账户密码：<input type="password" name="user_password" class="input-field" required></p>

                <!-- 根据激活的表单类型显示对应的功能表单 -->
                {% if active_form == 'password' %}
                <h3>修改账户密码</h3>
                <p>新密码：<input type="password" name="new_password1" class="input-field" required></p>
                <p>确认新密码：<input type="password" name="new_password2" class="input-field" required></p>

                {% elif active_form == 'phone' %}
                <h3>修改账户电话</h3>
                <p>新电话号码：<input type="tel" name="new_phone1" class="input-field" required></p>
                <p>确认新电话号码：<input type="tel" name="new_phone2" class="input-field" required></p>

                {% elif active_form == 'card' %}
                <h3>修改银行卡密码</h3>
                <p>选择银行卡：
                    <select name="card_id" class="input-field" required>
                        <option value="">请选择</option>
                        {% for card in card_list %}
                        <option value="{{ card['cardID'] }}">{{ card['cardID'] }}</option>
                        {% endfor %}
                    </select>
                </p>
                <p>原银行卡密码：<input type="password" name="old_card_pwd" class="input-field" required></p>
                <p>新银行卡密码：<input type="password" name="new_card_pwd" class="input-field" required></p>
                {% endif %}

                <button type="submit" name="submit_{{ active_form }}" class="form-button">提交修改</button>
            </form>
            {% endif %}
        </div>
    </div>

    <!-- 页脚 -->
    <div class="footer">
        © 2025 安心银行 
    </div>
</body>
</html>